/*
 * Copyright
 *
 */
package com.fare.taluo.web.action;

import java.util.Comparator;

import com.fare.taluo.vo.core.LowestPriceQueryVo;

/**
 * 【最低价按最低价升序排序】
 * 
 * @version
 * @author fangdongyang 2013-1-8 上午9:35:59
 * 
 */
public class ComparatorLowestPriceQuery implements Comparator {

	public int compare(Object arg0, Object arg1) {
		LowestPriceQueryVo vo1 = (LowestPriceQueryVo) arg0;
		LowestPriceQueryVo vo2 = (LowestPriceQueryVo) arg1;

		// 首先比较日期，如果日期相同，则比较最低价

		int flag = vo1.getDate().compareTo(vo2.getDate());
		if (flag == 0) {
			return Integer.valueOf(vo1.getPrice()).compareTo(Integer.valueOf(vo2.getPrice()));
		} else {
			return flag;
		}
	}
	

}
